sgdk: vdp.h File Reference

sgdk

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Classes | Defines | Functions | Variables
vdp.h File Reference

VDP main. More...

`#include "font.h"`

Go to the source code of this file.

## Classes

struct | VDPPlan

## Defines

#define | GFX_DATA_PORT 0xC00000
#define | GFX_CTRL_PORT 0xC00004
#define | GFX_HVCOUNTER_PORT 0xC00008
#define | VDP_FIFOEMPTY_FLAG (1 << 9)
#define | VDP_FIFOFULL_FLAG (1 << 8)
#define | VDP_VINTPENDING_FLAG (1 << 7)
#define | VDP_SPROVERFLOW_FLAG (1 << 6)
#define | VDP_SPRCOLLISION_FLAG (1 << 5)
#define | VDP_ODDFRAME_FLAG (1 << 4)
#define | VDP_VBLANK_FLAG (1 << 3)
#define | VDP_HBLANK_FLAG (1 << 2)
#define | VDP_DMABUSY_FLAG (1 << 1)
#define | VDP_PALMODE_FLAG (1 << 0)
#define | WINDOW window_adr
#define | WPLAN WINDOW
#define | HSCRL hscrl_adr
#define | SLIST slist_adr
#define | APLAN aplan_adr
#define | BPLAN bplan_adr
#define | VDP_WINDOW WINDOW
#define | VDP_PLAN_WINDOW VDP_WINDOW
#define | VDP_SCROLL_H HSCRL
#define | VDP_SPRITE_LIST SLIST
#define | VDP_PLAN_A APLAN
#define | VDP_PLAN_B BPLAN
#define | HSCROLL_PLANE 0
#define | HSCROLL_TILE 2
#define | HSCROLL_LINE 3
#define | VSCROLL_PLANE 0
#define | VSCROLL_2TILE 1
#define | INTERLACED_NONE 0
#define | INTERLACED_MODE1 1
#define | INTERLACED_MODE2 2
#define | TILE_SIZE 32
#define | TILE_INDEX_MASK (0xFFFF / TILE_SIZE)
#define | TILE_SPACE WINDOW
#define | TILE_MAXNUM (TILE_SPACE / TILE_SIZE)
#define | TILE_MAXINDEX (TILE_MAXNUM - 1)
#define | TILE_SYSTEMINDEX 0x0000
#define | TILE_SYSTEMLENGTH 0x10
#define | TILE_SYSTEMLENGHT TILE_SYSTEMLENGTH
#define | TILE_USERINDEX (TILE_SYSTEMINDEX + TILE_SYSTEMLENGTH)
#define | TILE_FONTINDEX (TILE_MAXNUM - FONT_LEN)
#define | TILE_USERLENGTH (TILE_FONTINDEX - TILE_USERINDEX)
#define | TILE_USERLENGHT TILE_USERLENGTH
#define | TILE_USERMAXINDEX (TILE_USERINDEX + TILE_USERLENGTH - 1)
#define | TILE_SYSTEM (TILE_SYSTEMINDEX * TILE_SIZE)
#define | TILE_USER (TILE_USERINDEX * TILE_SIZE)
#define | TILE_FONT (TILE_FONTINDEX * TILE_SIZE)
#define | PAL0 0
#define | PAL1 1
#define | PAL2 2
#define | PAL3 3
#define | GFX_READ_VRAM_ADDR(adr) ((0x0000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x00)
#define | GFX_READ_CRAM_ADDR(adr) ((0x0000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x20)
#define | GFX_READ_VSRAM_ADDR(adr) ((0x0000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x10)
#define | GFX_WRITE_VRAM_ADDR(adr) ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x00)
#define | GFX_WRITE_CRAM_ADDR(adr) ((0xC000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x00)
#define | GFX_WRITE_VSRAM_ADDR(adr) ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x10)
#define | GFX_DMA_VRAM_ADDR(adr) ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x80)
#define | GFX_DMA_CRAM_ADDR(adr) ((0xC000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x80)
#define | GFX_DMA_VSRAM_ADDR(adr) ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x90)
#define | GFX_DMA_VRAMCOPY_ADDR(adr) ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0xC0)
#define | GFX_VERT_SCROLL(adr) GFX_WRITE_VSRAM_ADDR(adr)
#define | GFX_HORZ_SCROLL(adr) GFX_WRITE_VRAM_ADDR(VDP_SCROLL_H + (adr))
#define | GET_VDPSTATUS(flag) ((*(vu16*)(GFX_CTRL_PORT)) & (flag))
#define | IS_PALSYSTEM GET_VDPSTATUS(VDP_PALMODE_FLAG)
#define | GET_HVCOUNTER (*(vu16*)(GFX_HVCOUNTER_PORT))
#define | GET_HCOUNTER (GET_HVCOUNTER & 0xFF)
#define | GET_VCOUNTER (GET_HVCOUNTER >> 8)

## Functions

void | VDP_init ()
| Initialize the VDP sub system.
u8 | VDP_getReg (u16 reg)
| Get VDP register value.
void | VDP_setReg (u16 reg, u8 value)
| Set VDP register value.
u8 | VDP_getEnable ()
| Returns VDP enable state.
void | VDP_setEnable (u8 value)
| Set VDP enable state.
u16 | VDP_getScanlineNumber ()
| Returns number of total scanline.
u16 | VDP_getScreenHeight ()
| Returns vertical screen resolution.
void | VDP_setScreenHeight224 ()
| Set vertical resolution to 224 pixels.
void | VDP_setScreenHeight240 ()
| Set vertical resolution to 240 pixels.
u16 | VDP_getScreenWidth ()
| Returns horizontal screen resolution.
void | VDP_setScreenWidth256 ()
| Set horizontal resolution to 256 pixels.
void | VDP_setScreenWidth320 ()
| Set horizontal resolution to 320 pixels.
u16 | VDP_getPlanWidth ()
| Returns background plan width (in tile).
u16 | VDP_getPlanHeight ()
| Returns background plan height (in tile).
void | VDP_setPlanSize (u16 w, u16 h)
| Set background plan size (in tile).
u8 | VDP_getHorizontalScrollingMode ()
| Returns plan horizontal scrolling mode.
u8 | VDP_getVerticalScrollingMode ()
| Returns plan vertical scrolling mode.
void | VDP_setScrollingMode (u16 hscroll, u16 vscroll)
| Set plan scrolling mode.
u8 | VDP_getBackgroundColor ()
| Returns the background color index.
void | VDP_setBackgroundColor (u8 value)
| Set the background color index.
u8 | VDP_getAutoInc ()
| Returns auto increment register value.
void | VDP_setAutoInc (u8 value)
| Set auto increment register value.
void | VDP_setHInterrupt (u8 value)
| Enable or Disable Horizontal interrupt.
void | VDP_setHilightShadow (u8 value)
| Enable or Disable Hilight / Shadow effect.
u8 | VDP_getHIntCounter ()
| Get Horizontal interrupt counter value.
void | VDP_setHIntCounter (u8 value)
| Set Horizontal interrupt counter value.
u16 | VDP_getAPlanAddress ()
| Get VRAM address (location) of Plan A tilemap.
u16 | VDP_getBPlanAddress ()
| Get VRAM address (location) of Plan B tilemap.
u16 | VDP_getWindowAddress ()
| Get VRAM address (location) of Window tilemap.
u16 | VDP_getWindowPlanAddress ()
u16 | VDP_getSpriteListAddress ()
| Get VRAM address (location) of Sprite list.
u16 | VDP_getHScrollTableAddress ()
| Get VRAM address (location) of H SCroll table.
void | VDP_setAPlanAddress (u16 value)

Set VRAM address (location) of Plan A tilemap.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

void | VDP_setWindowAddress (u16 value)

Set VRAM address (location) of Window tilemap.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

void | VDP_setWindowPlanAddress (u16 value)
void | VDP_setBPlanAddress (u16 value)

Set VRAM address (location) of Plan B tilemap.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

void | VDP_setSpriteListAddress (u16 value)

Set VRAM address (location) of Sprite list.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

void | VDP_setHScrollTableAddress (u16 value)

Set VRAM address (location) of H Scroll table.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The the window tilemap address is used internally to calculated how much space is available for tiles.

void | VDP_setScanMode (u16 mode)
| Sets the scan mode of the display.
void | VDP_waitDMACompletion ()
| Wait for DMA operation to complete.
void | VDP_waitFIFOEmpty ()
| Wait for VDP FIFO to be empty.
void | VDP_waitVSync ()
| Wait for Vertical Synchro.
void | VDP_resetScreen ()
| Reset background plan and palette.
void | VDP_showFPS (u16 float_display)
| Display number of Frame Per Second.

## Variables

const VDPPlan | PLAN_B
const VDPPlan | PLAN_A
u16 | window_adr
u16 | aplan_adr
u16 | bplan_adr
u16 | hscrl_adr
u16 | slist_adr
u16 | screenWidth
| Current screen width (horizontale resolution)
u16 | screenHeight
| Current screen height (verticale resolution)

## Detailed Description

VDP main.

Author:
  Stephane Dallongeville

Date:
  08/2011

This unit provides general VDP methods :

- initialisation
- get / set register
- get / set resolution
- enable / disable VDP features

## Define Documentation

#define APLAN aplan_adr

VDP background A tilemap address in VRAM.
Short version of VDP_PLAN_A definition.

#define BPLAN bplan_adr

VDP background B tilemap address in VRAM.
Short version of VDP_PLAN_B definition.

#define GET_HCOUNTER (GET_HVCOUNTER & 0xFF)

Returns Horizontal counter.

#define GET_HVCOUNTER (*(vu16*)(GFX_HVCOUNTER_PORT))

Returns HV counter.

#define GET_VCOUNTER (GET_HVCOUNTER >> 8)

Returns Vertical counter.

#define GET_VDPSTATUS | ( |  | flag | ) | ((*(vu16*)(GFX_CTRL_PORT)) & (flag))

Tests VDP status against specified flag (see VDP_XXX_FLAG).

#define GFX_CTRL_PORT 0xC00004

VDP Control port address.

#define GFX_DATA_PORT 0xC00000

VDP Data port address.

#define GFX_DMA_CRAM_ADDR | ( |  | adr | ) | ((0xC000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x80)

Set VDP command to issue a DMA transfert to specified CRAM address.

#define GFX_DMA_VRAM_ADDR | ( |  | adr | ) | ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x80)

Set VDP command to issue a DMA transfert to specified VRAM address.

#define GFX_DMA_VRAMCOPY_ADDR | ( |  | adr | ) | ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0xC0)

Set VDP command to issue a DMA VRAM copy to specified VRAM address.

#define GFX_DMA_VSRAM_ADDR | ( |  | adr | ) | ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x90)

Set VDP command to issue a DMA transfert to specified VSRAM address.

#define GFX_HORZ_SCROLL | ( |  | adr | ) | GFX_WRITE_VRAM_ADDR(VDP_SCROLL_H + (adr))

Helper to write in horizontal scroll table (same as GFX_WRITE_VRAM_ADDR(VDP_SCROLL_H + adr)).

#define GFX_HVCOUNTER_PORT 0xC00008

VDP HV counter port address.

#define GFX_READ_CRAM_ADDR | ( |  | adr | ) | ((0x0000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x20)

Set VDP command to read specified CRAM address.

#define GFX_READ_VRAM_ADDR | ( |  | adr | ) | ((0x0000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x00)

Set VDP command to read specified VRAM address.

#define GFX_READ_VSRAM_ADDR | ( |  | adr | ) | ((0x0000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x10)

Set VDP command to read specified VSRAM address.

#define GFX_VERT_SCROLL | ( |  | adr | ) | GFX_WRITE_VSRAM_ADDR(adr)

Helper to write in vertical scroll table (same as GFX_WRITE_VSRAM_ADDR).

#define GFX_WRITE_CRAM_ADDR | ( |  | adr | ) | ((0xC000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x00)

Set VDP command to write at specified CRAM address.

#define GFX_WRITE_VRAM_ADDR | ( |  | adr | ) | ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x00)

Set VDP command to write at specified VRAM address.

#define GFX_WRITE_VSRAM_ADDR | ( |  | adr | ) | ((0x4000 + ((adr) & 0x3FFF)) << 16) + (((adr) >> 14) | 0x10)

Set VDP command to write at specified VSRAM address.

#define HSCRL hscrl_adr

VDP horizontal scroll table address in VRAM.
Short version of VDP_SCROLL_H definition.

#define HSCROLL_LINE 3

Definition to set horizontal scroll to mode line.

#define HSCROLL_PLANE 0

Definition to set horizontal scroll to mode plan.

#define HSCROLL_TILE 2

Definition to set horizontal scroll to mode tile.

#define INTERLACED_MODE1 1

Interlaced Scanning Mode 1 - 8x8 dots per cell (normal vertical resolution)
In Interlaced Mode 1, the same pattern will be displayed on the adjacent lines of even and odd numbered fields.

#define INTERLACED_MODE2 2

Interlaced Scanning Mode 2 - 8x16 dots per cell (double vertical resolution)
In Interlaced Mode 2, different patterns can be displayed on the adjacent lines of even and odd numbered fields.

#define INTERLACED_NONE 0

Interlaced scanning mode disabled.
That is the default mode for the VDP.

#define IS_PALSYSTEM GET_VDPSTATUS(VDP_PALMODE_FLAG)

Tests if current system is a PAL system (50 Hz).

#define PAL0 0

Palette 0

#define PAL1 1

Palette 1

#define PAL2 2

Palette 2

#define PAL3 3

Palette 3

#define SLIST slist_adr

VDP sprite list table address in VRAM.
Short version of VDP_SPRITE_LIST definition.

#define TILE_FONT (TILE_FONTINDEX * TILE_SIZE)

Font tile address in VRAM.

#define TILE_FONTINDEX (TILE_MAXNUM - FONT_LEN)

Font base tile index.

#define TILE_MAXINDEX (TILE_MAXNUM - 1)

Maximum tile index in VRAM (related to TILE_MAXNUM).

#define TILE_MAXNUM (TILE_SPACE / TILE_SIZE)

Maximum number of tile in VRAM (related to TILE_SPACE).

#define TILE_SIZE 32

Size of a single tile in byte.

#define TILE_SPACE WINDOW

Space in byte for tile in VRAM (tile space ends where window tilemap starts)

#define TILE_SYSTEM (TILE_SYSTEMINDEX * TILE_SIZE)

System tile address in VRAM.

#define TILE_SYSTEMINDEX 0x0000

System base tile index in VRAM.

#define TILE_SYSTEMLENGHT TILE_SYSTEMLENGTH

Deprecated:
  Use TILE_SYSTEMLENGTH instead.

#define TILE_SYSTEMLENGTH 0x10

Number of system tile.

#define TILE_USER (TILE_USERINDEX * TILE_SIZE)

User tile address in VRAM.

#define TILE_USERINDEX (TILE_SYSTEMINDEX + TILE_SYSTEMLENGTH)

User base tile index.

#define TILE_USERLENGHT TILE_USERLENGTH

Deprecated:
  Use TILE_USERLENGTH instead.

#define TILE_USERLENGTH (TILE_FONTINDEX - TILE_USERINDEX)

Number of available user tile.

#define TILE_USERMAXINDEX (TILE_USERINDEX + TILE_USERLENGTH - 1)

Maximum tile index in VRAM for user.

#define VDP_DMABUSY_FLAG (1 << 1)

VDP DMA busy flag.

#define VDP_FIFOEMPTY_FLAG (1 << 9)

VDP FIFO empty flag.

#define VDP_FIFOFULL_FLAG (1 << 8)

VDP FIFO full flag.

#define VDP_HBLANK_FLAG (1 << 2)

VDP Horizontal blanking flag.

#define VDP_ODDFRAME_FLAG (1 << 4)

VDP odd frame flag.

#define VDP_PALMODE_FLAG (1 << 0)

VDP PAL mode flag.

#define VDP_PLAN_A APLAN

VDP background A tilemap address in VRAM.

#define VDP_PLAN_B BPLAN

VDP background B tilemap address in VRAM.

#define VDP_PLAN_WINDOW VDP_WINDOW

Deprecated:
  Use VDP_WINDOW instead.

#define VDP_SCROLL_H HSCRL

VDP horizontal scroll table address in VRAM.

#define VDP_SPRCOLLISION_FLAG (1 << 5)

VDP sprite collision flag.

#define VDP_SPRITE_LIST SLIST

VDP sprite list table address in VRAM.

#define VDP_SPROVERFLOW_FLAG (1 << 6)

VDP sprite overflow flag.

#define VDP_VBLANK_FLAG (1 << 3)

VDP Vertical blanking flag.

#define VDP_VINTPENDING_FLAG (1 << 7)

VDP Vertical interrupt pending flag.

#define VDP_WINDOW WINDOW

VDP window tilemap address in VRAM.

#define VSCROLL_2TILE 1

Definition to set vertical scroll to mode 2 tile.

#define VSCROLL_PLANE 0

Definition to set vertical scroll to mode plan.

#define WINDOW window_adr

VDP window tilemap address in VRAM.
Short version of VDP_WINDOW definition.

#define WPLAN WINDOW

Deprecated:
  Use WINDOW instead.

## Function Documentation

u8 VDP_getHorizontalScrollingMode | ( |  | ) |

Returns plan horizontal scrolling mode.

Possible values are: HSCROLL_PLANE, HSCROLL_TILE, HSCROLL_LINE

See also:
  VDP_setScrollingMode for more informations about scrolling mode.

u16 VDP_getPlanHeight | ( |  | ) |

Returns background plan height (in tile).

Possible values are: 32, 64, 128

u16 VDP_getPlanWidth | ( |  | ) |

Returns background plan width (in tile).

Possible values are: 32, 64, 128

u8 VDP_getReg | ( | u16 | reg | ) |

Get VDP register value.

Parameters:

  reg | Register number we want to retrieve value.

Returns:
  specified register value.

u16 VDP_getScanlineNumber | ( |  | ) |

Returns number of total scanline.

312 for PAL system and 262 for NTSC system.

u16 VDP_getScreenHeight | ( |  | ) |

Returns vertical screen resolution.

Always returns 224 on NTSC system as they only support this mode.
PAL system supports 240 pixels mode.

u16 VDP_getScreenWidth | ( |  | ) |

Returns horizontal screen resolution.

Returns 320 or 256 depending current horizontal resolution mode.

u8 VDP_getVerticalScrollingMode | ( |  | ) |

Returns plan vertical scrolling mode.

Possible values are: VSCROLL_PLANE, VSCROLL_2TILE

See also:
  VDP_setScrollingMode for more informations about scrolling mode.

u16 VDP_getWindowPlanAddress | ( |  | ) |

Deprecated:
  Use VDP_getWindowAddress(..) instead.

void VDP_init | ( |  | ) |

Initialize the VDP sub system.

Reset VDP registers, clear VRAM, set defaults grey, red, green & blue palette.

void VDP_resetScreen | ( |  | ) |

Reset background plan and palette.

Clear background plans and reset palette to grey / red / green / blue.

void VDP_setAPlanAddress | ( | u16 | value | ) |

Set VRAM address (location) of Plan A tilemap.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

Ex: VDP_setAPlanAddress(0xC000)
Will set the Plan A to at address 0xC000 in VRAM.

void VDP_setBPlanAddress | ( | u16 | value | ) |

Set VRAM address (location) of Plan B tilemap.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

Ex: VDP_setAPlanAddress(0xE000)
Will set the Plan B to at address 0xE000 in VRAM.

void VDP_setEnable | ( | u8 | value | ) |

Set VDP enable state.

You can temporary disable VDP to speed up VDP memory transfert.

void VDP_setHIntCounter | ( | u8 | value | ) |

Set Horizontal interrupt counter value.

When Horizontal interrupt is enabled, setting 5 here means that H int will occurs each (5+1) scanline.
Set value 0 to get H int at each scanline.

void VDP_setHInterrupt | ( | u8 | value | ) |

Enable or Disable Horizontal interrupt.

See also:
  VDP_setHIntCounter()

void VDP_setHScrollTableAddress | ( | u16 | value | ) |

Set VRAM address (location) of H Scroll table.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The the window tilemap address is used internally to calculated how much space is available for tiles.

Ex: VDP_setSpriteListAddress(0xB400)
Will set the HScroll table to at address 0xB400 in VRAM.

void VDP_setPlanSize | ( | u16 | w,
|  | u16 | h
| ) |  |

Set background plan size (in tile).

Parameters:

  w | width in tile. Possible values are 32, 64 or 128.
  h | height in tile. Possible values are 32, 64 or 128.

void VDP_setReg | ( | u16 | reg,
|  | u8 | value
| ) |  |

Set VDP register value.

Parameters:

  reg | Register number we want to set value.
  value | value to set.

void VDP_setScanMode | ( | u16 | mode | ) |

Sets the scan mode of the display.

Parameters:

  mode | Accepted values : INTERLACED_NONE, INTERLACED_MODE1, INTERLACED_MODE2

This function changes the scanning mode on the next display blanking period. In Interlaced Mode 1, the same pattern will be displayed on the adjacent lines of even and odd numbered fields. In Interlaced Mode 2, different patterns can be displayed on the adjacent lines of even and odd numbered fields. The number of cells on the screen stays the same regardless of which scanning mode is active.

void VDP_setScreenHeight224 | ( |  | ) |

Set vertical resolution to 224 pixels.

This is the only accepted mode for NTSC system.

void VDP_setScreenHeight240 | ( |  | ) |

Set vertical resolution to 240 pixels.

Only work on PAL system.

void VDP_setScrollingMode | ( | u16 | hscroll,
|  | u16 | vscroll
| ) |  |

Set plan scrolling mode.

Parameters:

  hscroll

  Horizontal scrolling mode :
  HSCROLL_PLANE = Scroll offset is applied to the whole plan.
  HSCROLL_TILE = Scroll offset is applied on a tile basis granularity (8 pixels bloc).
  HSCROLL_LINE = Scroll offset is applied on a line basis granularity (1 pixel).

  vscroll | Vertical scrolling mode : VSCROLL_PLANE = Scroll offset is applied to the whole plan. VSCROLL_2TILE = Scroll offset is applied on 2 tiles basis granularity (16 pixels bloc).

See also:
  VDP_setHorizontalScroll() to set horizontal scroll offset in mode plane.
  VDP_setHorizontalScrollTile() to set horizontal scroll offset(s) in mode tile.
  VDP_setHorizontalScrollLine() to set horizontal scroll offset(s) in mode line.
  VDP_setVerticalScroll() to set vertical scroll offset in mode plane.
  VDP_setVerticalScrollTile() to set vertical scroll offset(s) in mode 2-tile.

void VDP_setSpriteListAddress | ( | u16 | value | ) |

Set VRAM address (location) of Sprite list.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

Ex: VDP_setSpriteListAddress(0xB800)
Will set the Sprite list to at address 0xB800 in VRAM.

void VDP_setWindowAddress | ( | u16 | value | ) |

Set VRAM address (location) of Window tilemap.
WARNING: the window tilemap should always be the first object attribute in VRAM:
| system tiles
| user tiles
| window plan
v others (plan a, plan b, ...)
The window tilemap address is used internally to calculated how much space is available for tiles.

Ex: VDP_setWindowAddress(0xA000)
Will set the Window tilemap to at address 0xA000 in VRAM.

void VDP_setWindowPlanAddress | ( | u16 | value | ) |

Deprecated:
  Use VDP_setWindowAddress(..) instead.

void VDP_showFPS | ( | u16 | float_display | ) |

Display number of Frame Per Second.

Parameters:

  float_display | Display as float number.

This function actually display the number of time it was called in the last second.
i.e: for benchmarking you should call this method only once per frame update.

void VDP_waitVSync | ( |  | ) |

Wait for Vertical Synchro.

The method actually wait for the next start of Vertical blanking.

All Classes Files Functions Variables Typedefs Enumerations Defines